package com.jl.jlapp.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jl.jlapp.R;
import com.jl.jlapp.eneity.ActivitysAndCouponsByGoodsMsgModel;

import java.text.SimpleDateFormat;
import java.util.List;

public class DiscountAdapter
        extends BaseQuickAdapter<ActivitysAndCouponsByGoodsMsgModel.ResultDataBean.CouponsBean, BaseViewHolder> {
    int type = 1;

    public DiscountAdapter(@LayoutRes int paramInt, @Nullable List<ActivitysAndCouponsByGoodsMsgModel.ResultDataBean.CouponsBean> paramList) {
        super(paramInt, paramList);
    }

    protected void convert(BaseViewHolder paramBaseViewHolder, ActivitysAndCouponsByGoodsMsgModel.ResultDataBean.CouponsBean paramCouponsBean) {
        Object localObject = new SimpleDateFormat("yyyy-MM-dd");
        paramBaseViewHolder.setText(R.id.tv_discount_explain, paramCouponsBean.getUserCoupons().getCouponInformation().getName());
        paramBaseViewHolder.setText(R.id.tv_discount_money, paramCouponsBean.getUserCoupons().getCouponInformation().getPrice() + "");
        paramBaseViewHolder.setText(R.id.tv_discount_condition, "满¥" + paramCouponsBean.getUserCoupons().getCouponInformation().getUseLimit() + "可用");
        paramBaseViewHolder.setText(R.id.tv_discount_time_start, ((SimpleDateFormat) localObject).format(Long.valueOf(paramCouponsBean.getUserCoupons().getCouponInformation().getBeginValidityTime())));
        paramBaseViewHolder.setText(R.id.tv_discount_time_end, ((SimpleDateFormat) localObject).format(Long.valueOf(paramCouponsBean.getUserCoupons().getCouponInformation().getEndValidityTime())));
        TextView textView = (TextView) paramBaseViewHolder.getView(R.id.tv_discount_explain);
        localObject = (TextView) paramBaseViewHolder.getView(R.id.tv_discount_time_start);
        TextView localTextView1 = (TextView) paramBaseViewHolder.getView(R.id.tv_discount_time_strip);
        TextView localTextView2 = (TextView) paramBaseViewHolder.getView(R.id.tv_discount_time_end);
        TextView localTextView3 = (TextView) paramBaseViewHolder.getView(R.id.tv_discount_money);
        TextView localTextView4 = (TextView) paramBaseViewHolder.getView(R.id.tv_discount_money_unit);
        TextView localTextView5 = (TextView) paramBaseViewHolder.getView(R.id.tv_discount_condition);
        RelativeLayout localRelativeLayout = (RelativeLayout) paramBaseViewHolder.getView(R.id.coupon_background);
        if (this.type == 1) {
            localTextView3.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.red));
            localTextView4.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.red));
            localTextView5.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.moreText));
            textView.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
            ((TextView) localObject).setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
            localTextView1.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
            localTextView2.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
            localRelativeLayout.setBackgroundResource(R.drawable.coupe_bg);
            return;
        }
        localTextView3.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.white));
        localTextView4.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.white));
        localTextView5.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.white));
        textView.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.coupon_explanation));
        ((TextView) localObject).setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.light_gray));
        localTextView1.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.light_gray));
        localTextView2.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.light_gray));
        localRelativeLayout.setBackgroundResource(R.drawable.coupe_bg_disable);
    }

    public void setType(int paramInt) {
        this.type = paramInt;
    }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/adapter/DiscountAdapter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */